<?php
include "config/config.php";
include_once "lib/Surat_keluar.php";
include_once "lib/Sifat.php";
include_once "lib/Tujuan_surat.php";
include_once "lib/Jenis.php";

session_start();
if(!isset($_SESSION['nip']) && !isset($_SESSION['kewenangan']) && !$_SESSION['unit']){

	header("Location:index.php");
}

$config=new config();
$config->connect();


?>
<html>
<head>
</head>
<body>
		
    <table border=0 align="center" cellspacing=0 cellpadding=1 width=100%>
		<tr>
			<td>
				<table align="center" cellspacing=0 cellpadding=1 width=100%>
					<tr>
						<td width=20% align="center"> 
							<img src="images/depkeu.png" />
						</td>
						<td width=80%> 
							<div align="center" style="font-weight:bold; font-size:12px">
							<br/>
							KEMENTERIAN KEUANGAN REPUBLIK INDONESIA <br/>
							DIREKTORAT JENDERAL PERBENDAHARAAN <br/>
							KANTOR WILAYAH PROVINSI GORONTALO
							</div>
							<div align="center" style="font-size:8px;">
							Jl. Raden Saleh No.3, Gorontalo <br/>
							Telp:0435-826694, Fax:0435-824142<br/>
							</div>
							
						</td>
				</table>
				
			</td>
		</tr>
		
		<tr>
			<td>
				<div align="center" style="font-size:10px;">
				<hr>
				<br>
				<h1>EKSPEDISI SURAT KELUAR</h1>
				<br/>
				</div>
			</td>
		</tr>
					
	</table>
	<table border=1 style="font-size:12px;" align="center" cellspacing=0 cellpadding=0 height=8% width=100%>
		<tr>
			<th width=5%>No.</th>
			<th width=20%>No. Surat</th>
			<th width=35%>Tujuan</th>
			<th width=15%>Tanggal Diterima</th>
			<th width=25%>Nama dan TTD Penerima</th>
		</tr>
		
		<?php
		if(isset($_POST['tujuan_sk']) && !empty($_POST['tujuan_sk'])){ 
		$tujuan = $_POST['tujuan_sk'];
		$i=1;
		foreach($tujuan as $Tujuan){ ?>
		<tr>
		<?php
			
			$daftar_tujuan = new Daftar_tujuan_surat();
			$tujuan_sk = $daftar_tujuan->getById($Tujuan);
			
			if(!empty($tujuan_sk)){
				
					$daftar_sk = new Daftar_surat_keluar();
					$sk = $daftar_sk->getById($tujuan_sk->getKdSK());
					$daftar_jenis = new Daftar_jenis();
					$jenis = $daftar_jenis->getById($sk->getJenis());
					?>
					<td><?php echo $i ?></td>
					<td><?php echo ucwords($jenis->getJenis())."-".$sk->getNomor() ;?></td>
					<td><?php echo ucwords($tujuan_sk->getTujuan()); ?></td>
					<td><div></div></td>
					<td><div></div></td>
					
				
				<?php }  ?>
			</tr>
		<?php $i++;} ?>
		
		<?php } ?>
		
	</table>
	
	
<body>
<html>
<script type="text/javascript">
	onload=function cetak(){
		window.print();
		window.onfocus = function() { window.close(); }
		window.location="pengiriman_surat_keluar.php";
	}
</script>





